import 'package:flutter/material.dart';

class SearchPage extends StatefulWidget {
  SearchPage({Key key}) : super(key: key);
  @override
  _SearchPageState createState() => _SearchPageState();
}

class _SearchPageState extends State<SearchPage> {
  String text;

  _SearchPageState({this.text: '默认的内容'});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('SearchPage'),
        leading: IconButton(
          icon: Icon(Icons.menu),
          onPressed: () {},
        ),
        actions: [
          IconButton(
            icon: Icon(Icons.search_sharp),
            onPressed: () {},
          ),
        ],
        backgroundColor: Colors.black87,
        centerTitle: true,
      ),
      body: Center(
          child: Column(
        children: [
          Text(this.text),
          RaisedButton(
            onPressed: () {
              Navigator.of(context).pop();
            },
            child: Text('返回上一页'),
          )
        ],
      )),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          Navigator.of(context).pop();
        },
        child: Text('返回'),
      ),
    );
  }
}
